<?php
require('foo.config.php');
/**
 * @author @author Samrat Khan & Sadik Sarfaraz - Apr 9, 2013
 */
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title><?php echo $BasicInfo['title']; ?> Version: <?php echo $BasicInfo['version']; ?></title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="<?php echo $BasicInfo['description']; ?>">
        <meta name="author" content="<?php echo $BasicInfo['author']; ?>">
        <link href="<?php echo CONTENTPATH; ?>/foo-drawer/css/bootstrap.min.css" rel="stylesheet">
        <link href="<?php echo CONTENTPATH; ?>/foo-drawer/css/bootstrap-responsive.min.css" rel="stylesheet">
        <link href="<?php echo CONTENTPATH; ?>/foo-drawer/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
        <link href="<?php echo CONTENTPATH; ?>/foo-drawer/css/ui-lightness/jquery-ui-1.10.3.custom.css" rel="stylesheet">
        <link href="<?php echo CONTENTPATH; ?>/foo-drawer/css/custom.css" rel="stylesheet">

        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/jquery-1.9.1.js" type="text/javascript"></script>
        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/jquery-ui-1.10.3.custom.js" type="text/javascript"></script>
        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/bootstrap.js" type="text/javascript"></script>
        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/modernizr-2.6.2-respond-1.1.0.min.js" type="text/javascript"></script>
        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/jquery.validate.js" type="text/javascript"></script>
        <!--<script src="<?php //echo CONTENTPATH; ?>/foo-drawer/js/jquery-ui-timepicker-addon.js" type="text/javascript"></script>-->
        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/jquery.easypassgen.js" type="text/javascript"></script>
        <script src="<?php echo CONTENTPATH; ?>/foo-drawer/js/custom.js" type="text/javascript"></script>
        <script type="text/javascript">
            var tableToExcel = (function() {
            var uri = 'data:application/vnd.ms-excel;base64,'
            , template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
            , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
            , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
                return function(table, name) {
                    if (!table.nodeType) table = document.getElementById(table)
                    var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
                    window.location.href = uri + base64(format(template, ctx))
                }
            })()
        </script>
        <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
          <script src="js/html5shiv.js"></script>
        <![endif]-->
        <link rel="shortcut icon" href="ico/favicon.png">
    </head>
    <body>
        <?php
            if (!empty($_SESSION['user'])) {
        ?>
            <div class="navbar navbar-fixed-top">
                <div class="navbar-inner">
                    <div class="row-fluid">
                        <button data-target=".nav-collapse" data-toggle="collapse" class="btn btn-navbar" type="button">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a href="dashboard.php" class="brand">WMS v <?php echo $BasicInfo['version']; ?></a>
                        <div class="nav-collapse collapse">
                            <ul role="navigation" class="nav">
                                <?php
                                    if($_SESSION['user']['utype'] == 1 || $_SESSION['user']['utype'] == 2 || $_SESSION['user']['utype'] == 3) {
                                ?>
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" role="button" href="add-stockin.php" id="drop1">Inbound <b class="caret"></b></a>
                                    <ul aria-labelledby="drop1" role="menu" class="dropdown-menu">
                                        <li role="presentation"><a href="add-stockin.php" tabindex="-1" role="menuitem">Inbound Entry</a></li>
                                    </ul>
                                </li>
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" role="button" id="drop2" href="#">Outbound <b class="caret"></b></a>
                                    <ul aria-labelledby="drop2" role="menu" class="dropdown-menu">
                                        <li role="presentation"><a href="add-stockout.php" tabindex="-1" role="menuitem">Outbound Entry</a></li>
                                    </ul>
                                </li> 
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" role="button" id="drop2" href="#">Faulty Return <b class="caret"></b></a>
                                    <ul aria-labelledby="drop2" role="menu" class="dropdown-menu">
                                        <li role="presentation"><a href="add-faulty-return.php" tabindex="-1" role="menuitem">Faulty Return Entry</a></li>
                                    </ul>
                                </li> 
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" role="button" id="drop2" href="#">Faulty Export <b class="caret"></b></a>
                                    <ul aria-labelledby="drop2" role="menu" class="dropdown-menu">
                                        <li role="presentation"><a href="add-faulty-export.php" tabindex="-1" role="menuitem">Faulty Export Entry</a></li>
                                    </ul>
                                </li>
                                <?php
                                    }
                                    if($_SESSION['user']['utype'] == 1 || $_SESSION['user']['utype'] == 2) {
                                ?>
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" role="button" id="drop2" href="#">Admin Panel <b class="caret"></b></a>
                                    <ul aria-labelledby="dropdownMenu" role="menu" class="dropdown-menu">
                                        <?php
                                        if($_SESSION['user']['utype'] == 1) {
                                        ?>
                                        <li class="dropdown-submenu">
                                            <a href="<?php echo CONTENTPATH; ?>/viewwarehouses.php" tabindex="-1" tabindex="-1">Warehouse</a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<?php echo CONTENTPATH; ?>/add-warehouse.php" tabindex="-1">Add Warehouse</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/viewwarehouses.php" tabindex="-1">View Warehouses</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/junkremover.php" tabindex="-1">Junk Remover</a></li>
                                            </ul>
                                        </li>
                                        <li class="divider"></li>
                                        <li class="dropdown-submenu">
                                            <a href="<?php echo CONTENTPATH; ?>/viewusers.php" tabindex="-1" tabindex="-1">Users</a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<?php echo CONTENTPATH; ?>/add-user.php" tabindex="-1">Add User</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/viewusers.php" tabindex="-1">View Users</a></li>
                                            </ul>
                                        </li>
                                        <li class="divider"></li>
                                        <li class="dropdown-submenu">
                                            <a href="<?php echo CONTENTPATH; ?>/viewcustomers.php" tabindex="-1" tabindex="-1">Customer</a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<?php echo CONTENTPATH; ?>/add-customer.php" tabindex="-1">Add Customer</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/viewcustomers.php" tabindex="-1">View Customers</a></li>
                                            </ul>
                                        </li>
                                        <li class="divider"></li>
                                        <?php
                                        }
                                        ?>
                                        <?php
                                        if($_SESSION['user']['utype'] == 1 || $_SESSION['user']['utype'] == 2) {
                                        ?>
                                        <li class="dropdown-submenu">
                                            <a href="<?php echo CONTENTPATH; ?>/viewengineers.php" tabindex="-1" tabindex="-1">Engineer</a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<?php echo CONTENTPATH; ?>/add-engineer.php" tabindex="-1">Add Engineer</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/viewengineers.php" tabindex="-1">View Engineers</a></li>
                                            </ul>
                                        </li>
                                        <li class="divider"></li>
                                        <li class="dropdown-submenu">
                                            <a href="<?php echo CONTENTPATH; ?>/viewemployees" tabindex="-1" tabindex="-1">Employee</a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<?php echo CONTENTPATH; ?>/add-employee.php" tabindex="-1">Add Employee</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/viewemployees" tabindex="-1">View Employees</a></li>
                                            </ul>
                                        </li>
                                        <li class="divider"></li>
                                        <li class="dropdown-submenu">
                                            <a href="<?php echo CONTENTPATH; ?>/viewproject.php" tabindex="-1" tabindex="-1">Project</a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<?php echo CONTENTPATH; ?>/add-project.php" tabindex="-1">Add Project</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/viewproject.php" tabindex="-1">View Projects</a></li>
                                            </ul>
                                        </li>
                                        <li class="divider"></li>
                                        <li class="dropdown-submenu">
                                            <a href="<?php echo CONTENTPATH; ?>/viewresponse.php" tabindex="-1" tabindex="-1">Response Type</a>
                                            <ul class="dropdown-menu">
                                                <li><a href="<?php echo CONTENTPATH; ?>/add-response.php" tabindex="-1">Add Response Type</a></li>
                                                <li><a href="<?php echo CONTENTPATH; ?>/viewresponse.php" tabindex="-1">View Response Types</a></li>
                                            </ul>
                                        </li>
                                        <?php
                                        }
                                        ?>
                                    </ul>
                                </li>
                                <?php
                                    }
                                ?>
                                <?php
                                if($_SESSION['user']['utype'] == 1 || $_SESSION['user']['utype'] == 2 || $_SESSION['user']['utype'] == 3 || $_SESSION['user']['utype'] == 4) {
                                ?>
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" role="button" id="drop2" href="#">Reports <b class="caret"></b></a>
                                    <ul aria-labelledby="dropdownMenu" role="menu" class="dropdown-menu">
                                        <li role="presentation"><a href="viewstockin.php" tabindex="-1" role="menuitem">Inbound Report</a></li>
                                        <li role="presentation"><a href="viewstockout.php" tabindex="-1" role="menuitem">Outbound Report</a></li>
                                        <li role="presentation"><a href="viewfaulties.php" tabindex="-1" role="menuitem">Faulty Return Report</a></li>
                                        <li role="presentation"><a href="viewfaultyexport.php" tabindex="-1" role="menuitem">Faulty Export Report</a></li>
                                        <li role="presentation"><a href="reports.php" tabindex="-1" role="menuitem">Movement History</a></li>
                                        <li role="presentation"><a href="summary.php" tabindex="-1" role="menuitem">The summary</a></li>
                                        <li role="presentation"><a href="sihand.php" tabindex="-1" role="menuitem">Stockin Hand</a></li>
                                        <li role="presentation"><a href="returnnote.php" tabindex="-1" role="menuitem">Return Notification</a></li>
                                    </ul>
                                </li>
                                <?php
                                }
                                ?>
                            </ul>
                            <ul role="navigation" class="nav pull-right settings">
                                <li class="dropdown">
                                    <a data-toggle="dropdown" class="dropdown-toggle" role="button" href="#" id="drop1"><?php echo htmlentities($_SESSION['user']['username'], ENT_QUOTES, 'UTF-8'); ?> <i class="icon-large icon-user"></i> <b class="caret"></b></a>
                                    <ul aria-labelledby="drop1" role="menu" class="dropdown-menu">
                                        <li role="presentation"><a href="<?php echo CONTENTPATH; ?>/change.php" tabindex="-1" role="menuitem">Change Profile</a></li>
                                        <li class="divider" role="presentation"></li>
                                        <li role="presentation"><a href="<?php echo CONTENTPATH; ?>/logout.php" tabindex="-1" role="menuitem">Logout</a></li>
                                    </ul>
                                </li>
                                <li class="divider-vertical"></li>
                                <li>&nbsp;</li>
                                <li class="divider-vertical"></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        <?php } ?>
        <div class="row-fluid">